package com.example.designmodel.singleinstance

import kotlin.math.sin

/**
 * Created by  you
 * Date: 2022/3/14
 * Time: 18:30
 * 懒汉式
 */
class SingleInstance01 private constructor() {

    companion object {
      private var singleInstance01:SingleInstance01?=null
        get() {
            if (field==null){
                field = SingleInstance01()
            }
            return field
        }
        fun get():SingleInstance01{
            return singleInstance01!!
        }
    }

}